$(function () {
    var _thisPage = null, _user = null, _html = [];

    var incomePage = function () {
        this.init();
    };
    incomePage.prototype = {
        init: function () {
            this.initData();
            this.bindEvent();
        },
        initData: function () {
            $("div[name=apply]").hide();
            $("div[name=earning]").hide();
        },
        bindEvent: function () {

            //点击回退
            $("#back").on("tap", function () {
                back();
            });

            //商家报备，商家签约，惠赚钱切换
            $("#ul_tab li").on("tap", function () {
                var tip = $(this).attr("tip");
                $(this).addClass("hover").siblings().removeClass("hover");
                var value = "translateX(" + $(this).offset().left + "px)";
                $("#colorline").css({
                    "transform": value,
                    "-moz-transform": value,
                    "-webkit-transform": value,
                    "-o-transform": value,
                    "-ms-transform": value
                });
                //加载
                $("#ul_tab~div").hide();
                $("div[name='" + tip + "']").show();
            });
        }
    };

    _thisPage = new incomePage();
});
